<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		.small ul{
			list-style: none;
		}
		.small li{
			float: left;
			padding: 10px;
		}
	</style>
</head>
<body>
	<div>
		<img src="01b.jpg" alt="" id="bigImg">
	</div>
	
	<div class="small">
			<ul>
				<li><a href="#"><img src="01s.jpg" alt=""></a></li>
				<li><a href="#"><img src="02s.jpg" alt=""></a></li>
				<li><a href="#"><img src="03s.jpg" alt=""></a></li>
				<li><a href="#"><img src="04s.jpg" alt=""></a></li>
			</ul>
	</div>
	<script>
		var bigImg=document.querySelector('#bigImg');
		var small=document.querySelector('.small');
		var lis=small.getElementsByTagName('li');
		for (var i = 0; i < lis.length; i++) {
			lis[i].index=i+1;
			lis[i].onclick=function () {
				bigImg.src='0'+this.index+'b.jpg'
			}
		}
	</script>
</body>
</html>
<!-- 	<div>
		<div class = "mag">
			<img src="01b.jpg" alt="">
		</div>
		<div class = "small">
			<ul>
				<li>
					<a href="#">
						<img src="01s.jpg" alt="">
					</a>
				<>
				<li>
					<a href="#">
						<img src="02s.jpg" alt="">
					</a>
				<>
				<li>
					<a href="#">
						<img src="03s.jpg" alt="">
					</a>
				<>
				<li>
					<a href="#">
						<img src="04s.jpg" alt="">
					</a>
				<>
			</ul>
		</div>
	</div> -->